import request from '@/utils/request'
// 处置记录 API接口
const cre_work_recordApi = {
    list: '/cre_work_record/list',
    save: '/cre_work_record/save',
    view: '/cre_work_record/view',
    del: '/cre_work_record/delete',
    dels: '/cre_work_record/batchDel',
    output: '/cre_work_record/output',
    exportExcelTemplate: '/cre_work_record/exportExcelTemplate',
    importExcel: '/cre_work_record/importExcel',
    queryList: '/cre_work_record/queryList',
}

/**
 * 关联查询处置记录列表
 * @param {*} ids
 */
 export function queryList (pageinfo) {
    return request({
        url: cre_work_recordApi.queryList,
        method: 'post',
        data: pageinfo
    })
}

/**
 * 导入处置记录Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append("file", data);
  return request({
    url: cre_work_recordApi.importExcel,
    headers: {"Content-Type": "multipart/form-data"},
    method: 'post',
    data: body
  })
}

/**
 * 导出处置记录Excel模板
 */
export function exportExcelTemplate () {
    return request({
        url: cre_work_recordApi.exportExcelTemplate,
        method: 'post',
        responseType: 'blob'
    })
}

/**
 * 导出处置记录
 */
export function output (data) {
    return request({
        url: cre_work_recordApi.output,
        method: 'post',
        data: data ,
        responseType: 'blob'
    })
}
/**
 * 批量删除处置记录
 * @param {*} ids
 */
export function delCre_work_records (ids) {
    return request({
        url: cre_work_recordApi.dels,
        method: 'post',
        params: {ids}
    })
}
/**
 * 删除处置记录
 * @param {*} id
 */
export function delCre_work_record (id) {
    return request({
        url: cre_work_recordApi.del,
        method: 'post',
        params: {id}
    })
}
/**
 * 查看、编辑处置记录
 * @param {*} id
 */
export function viewCre_work_record (id) {
    return request({
        url: cre_work_recordApi.view,
        method: 'get',
        params: {id}
    })
}
/**
 * 保存处置记录
 * @param {*} body
 */
export function saveCre_work_record (body) {
    return request({
        url: cre_work_recordApi.save,
        method: 'post',
        data: body
    })
}
/**
 * 查询处置记录列表
 * @param {*} body
 */
export function queryCre_work_recordList (body) {
    return request({
        url: cre_work_recordApi.list,
        method: 'post',
        data: body
    })
}